package com.review.reviewsb.mapper;

import com.review.reviewsb.domain.Video;
import org.springframework.stereotype.Repository;

import java.lang.annotation.Repeatable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: reviewSb
 * @description: 模拟dao返回数据
 * @author: YaoZhiLi
 * @create: 2021-07-03 08:38
 */

@Repository
public class VideoMapper {
    private static Map<Integer, Video> videoMap = new HashMap<>();

    static {
        videoMap.put(1, new Video(1, "视频1"));
        videoMap.put(2, new Video(2, "视频1"));
        videoMap.put(3, new Video(3, "视频1"));
        videoMap.put(4, new Video(4, "视频1"));
        videoMap.put(5, new Video(5, "视频1"));
    }

    public List<Video>listVideo(){
        List<Video> list = new ArrayList<>();
        list.addAll(videoMap.values());
        return list;
    }
}